{__NOLAYOUT__}
<Widget:show col="12" bdcls="no-padding" title="上传素材">
<div class="upfiel_f row">
    <Ui:Field col="12" name="dirname" label="选择文件夹" hideipt="true">
    <select name="dirname" class="form-control ">
        <option value="cover">封面</option>
        <option value="background">背景</option>
        <option value="icon">图标</option>
    </select>
</Ui:Field>
<div class=" col-md-12 col-sm-12 col-xs-12 col-lg-12">
    <input multiple=true id="upload" name="file" class="file-loading file" type="file" data-preview-file-type="text">
</div>
</div>
</Widget:show>
<script type="text/javascript">
$(function(){
    $("#upload").fileinput({
        'showUpload':true,
        'previewFileType':'any',
        showPreview:false,
        // 'uploadAsync': true,
        'maxFileCount': 5,
        // 'showUpload': true,
        // 'showPreview': false,
        'uploadUrl': '{:U('FileManger/upload')}',
        uploadExtraData:function(){
            var out = {}, key, i = 0;
            out['dirname'] = $('.upfiel_f select[name=dirname]').val();
            return out;
        },
    }).on('filebatchuploadcomplete',function (event, files, extra) {
        $("#upload").fileinput('reset');
    });
})
function showImg(record, rowIndex, colIndex, options) {
    var url =  [table].getRecordIndexValue(record, 'url');
    if (url)
        return '<a target=_blank href='+url+'><img class="img img-responsive" src='+url+'></a>';
    else
        return '';
}    
</script>